<?php

/**
 * Created by PhpStorm.
 * User: luanpeng
 * Date: 2017/2/7
 * Time: 18:25
 */
namespace app\index\validate;

class CustomerV extends Base
{

    protected $rule =   [
        '__token__' => 'token',
        'c_company'  => 'require',
        'c_areaid'  => 'require',
        'c_contacts'  => 'require',
        'c_mobile'  => 'require',
        'c_fax'  => 'require',
        'c_address'  => 'require',
        's_company'  => 'require',

        'i_company'  => 'require',
        'i_product'  => 'require',
        'i_model'  => 'require',
        'i_num'  => 'require',
        'i_unit'  => 'require',
        'i_leader'  => 'require',
        'i_endtime'  => 'require',
        'i_recipients'  => 'require',

        'q_price'   => 'require',
        'q_unit'   => 'require',
        'q_totalprice'   => 'require',
        'q_company'   => 'require',
        'q_deliverytime'   => 'require'


    ];

    protected $message  =   [
        '__token__.token'   => '表单令牌不正确,请保存表单相关数据并手动刷新页面!|__token__',
        'c_company.require' => '请填写公司名称!|c_company',
        'c_areaid.require'  => '请选择区域!|c_areaid',
        'c_contacts.require'=> '请填写联系人!|c_contacts',
        'c_mobile.require'  => '请填写手机号!|c_mobile',
        'c_fax.require'     => '请填写公司传真!|c_fax',
        'c_address.require' => '请填写公司地址!|c_address',
        's_company.require' => '请填写公司名称!|s_company',

        'i_company.require'     => '请填写公司名称!|i_company',
        'i_product.require'     => '请填写产品名称!|i_product',
        'i_model.require'       => '请填写图号/型号!|i_model',
        'i_num.require'        => '请填写数量!|i_num',
        'i_num.number'        => '数量必须是数字!|i_num',
        'i_unit.require'        => '请填写计量单位!|i_unit',
        'i_leader.require'      => '请填写项目负责人!|i_leader',
        'i_endtime.require'     => '请填写截至时间!|i_endtime',
        'i_recipients.require'  => '请填写信息接受人!|i_recipients',

        'q_price'        => '请填写单价!|q_price',
        'q_unit'         => '请填写单位!|q_unit',
        'q_totalprice'   => '请填写总额!|q_totalprice',
        'q_company'      => '请填写报价公司!|q_company',
        'q_deliverytime' => '请填写交货期!|q_deliverytime'


    ];

    protected $scene = [
    'tk' => ['__token__'],
    'add' => ['c_company','c_areaid','c_contacts','c_mobile','c_fax','c_address'],
    'edit' => ['__token__','c_contacts','c_mobile','c_fax','c_address'],
    'supplier' => ['s_company'],
    'inquiryAdd' => ['i_company','i_product','i_model','i_num','i_unit','i_leader','i_endtime','i_recipients'],
    'quoteAdd' => ['q_price','q_unit','q_totalprice','q_company','q_deliverytime'],
    ];
}